home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / ZSI / TCnumbers.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2008-10-13  |  6.7 KB  |  191 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import types
  5. from ZSI import _copyright, _inttypes, _floattypes, _seqtypes, EvaluateException
  6. from ZSI.TC import TypeCode, Integer, Decimal
  7. from ZSI.wstools.Namespaces import SCHEMA
  8.  
  9. class IunsignedByte(Integer):
  10.     type = (SCHEMA.XSD3, 'unsignedByte')
  11.     parselist = [
  12.         (None, 'unsignedByte')]
  13.     seriallist = []
  14.  
  15.  
  16. class IunsignedShort(Integer):
  17.     type = (SCHEMA.XSD3, 'unsignedShort')
  18.     parselist = [
  19.         (None, 'unsignedShort')]
  20.     seriallist = []
  21.  
  22.  
  23. class IunsignedInt(Integer):
  24.     type = (SCHEMA.XSD3, 'unsignedInt')
  25.     parselist = [
  26.         (None, 'unsignedInt')]
  27.     seriallist = []
  28.  
  29.  
  30. class IunsignedLong(Integer):
  31.     type = (SCHEMA.XSD3, 'unsignedLong')
  32.     parselist = [
  33.         (None, 'unsignedLong')]
  34.     seriallist = []
  35.  
  36.  
  37. class Ibyte(Integer):
  38.     type = (SCHEMA.XSD3, 'byte')
  39.     parselist = [
  40.         (None, 'byte')]
  41.     seriallist = []
  42.  
  43.  
  44. class Ishort(Integer):
  45.     type = (SCHEMA.XSD3, 'short')
  46.     parselist = [
  47.         (None, 'short')]
  48.     seriallist = []
  49.  
  50.  
  51. class Iint(Integer):
  52.     type = (SCHEMA.XSD3, 'int')
  53.     parselist = [
  54.         (None, 'int')]
  55.     seriallist = [
  56.         types.IntType]
  57.  
  58.  
  59. class Ilong(Integer):
  60.     type = (SCHEMA.XSD3, 'long')
  61.     parselist = [
  62.         (None, 'long')]
  63.     seriallist = [
  64.         types.LongType]
  65.  
  66.  
  67. class InegativeInteger(Integer):
  68.     type = (SCHEMA.XSD3, 'negativeInteger')
  69.     parselist = [
  70.         (None, 'negativeInteger')]
  71.     seriallist = []
  72.  
  73.  
  74. class InonPositiveInteger(Integer):
  75.     type = (SCHEMA.XSD3, 'nonPositiveInteger')
  76.     parselist = [
  77.         (None, 'nonPositiveInteger')]
  78.     seriallist = []
  79.  
  80.  
  81. class InonNegativeInteger(Integer):
  82.     type = (SCHEMA.XSD3, 'nonNegativeInteger')
  83.     parselist = [
  84.         (None, 'nonNegativeInteger')]
  85.     seriallist = []
  86.  
  87.  
  88. class IpositiveInteger(Integer):
  89.     type = (SCHEMA.XSD3, 'positiveInteger')
  90.     parselist = [
  91.         (None, 'positiveInteger')]
  92.     seriallist = []
  93.  
  94.  
  95. class Iinteger(Integer):
  96.     type = (SCHEMA.XSD3, 'integer')
  97.     parselist = [
  98.         (None, 'integer')]
  99.     seriallist = []
  100.  
  101.  
  102. class IEnumeration(Integer):
  103.     
  104.     def __init__(self, choices, pname = None, **kw):
  105.         Integer.__init__(self, pname, **kw)
  106.         self.choices = choices
  107.         t = type(choices)
  108.         if t in _seqtypes:
  109.             self.choices = tuple(choices)
  110.         elif TypeCode.typechecks:
  111.             raise TypeError('Enumeration choices must be list or sequence, not ' + str(t))
  112.         
  113.         if TypeCode.typechecks:
  114.             for c in self.choices:
  115.                 if type(c) not in _inttypes:
  116.                     raise TypeError('Enumeration choice "' + str(c) + '" is not an integer')
  117.                     continue
  118.             
  119.         
  120.  
  121.     
  122.     def parse(self, elt, ps):
  123.         val = Integer.parse(self, elt, ps)
  124.         if val not in self.choices:
  125.             raise EvaluateException('Value "' + str(val) + '" not in enumeration list', ps.Backtrace(elt))
  126.         
  127.         return val
  128.  
  129.     
  130.     def serialize(self, elt, sw, pyobj, name = None, orig = None, **kw):
  131.         if pyobj not in self.choices:
  132.             raise EvaluateException('Value not in int enumeration list', ps.Backtrace(elt))
  133.         
  134.         Integer.serialize(self, elt, sw, pyobj, name = name, orig = orig, **kw)
  135.  
  136.  
  137.  
  138. class FPfloat(Decimal):
  139.     type = (SCHEMA.XSD3, 'float')
  140.     parselist = [
  141.         (None, 'float')]
  142.     seriallist = [
  143.         types.FloatType]
  144.  
  145.  
  146. class FPdouble(Decimal):
  147.     type = (SCHEMA.XSD3, 'double')
  148.     parselist = [
  149.         (None, 'double')]
  150.     seriallist = []
  151.  
  152.  
  153. class FPEnumeration(FPfloat):
  154.     
  155.     def __init__(self, choices, pname = None, **kw):
  156.         FPfloat.__init__(self, pname, **kw)
  157.         self.choices = choices
  158.         t = type(choices)
  159.         if t in _seqtypes:
  160.             self.choices = tuple(choices)
  161.         elif TypeCode.typechecks:
  162.             raise TypeError('Enumeration choices must be list or sequence, not ' + str(t))
  163.         
  164.         if TypeCode.typechecks:
  165.             for c in self.choices:
  166.                 if type(c) not in _floattypes:
  167.                     raise TypeError('Enumeration choice "' + str(c) + '" is not floating point number')
  168.                     continue
  169.             
  170.         
  171.  
  172.     
  173.     def parse(self, elt, ps):
  174.         val = Decimal.parse(self, elt, ps)
  175.         if val not in self.choices:
  176.             raise EvaluateException('Value "' + str(val) + '" not in enumeration list', ps.Backtrace(elt))
  177.         
  178.         return val
  179.  
  180.     
  181.     def serialize(self, elt, sw, pyobj, name = None, orig = None, **kw):
  182.         if pyobj not in self.choices:
  183.             raise EvaluateException('Value not in int enumeration list', ps.Backtrace(elt))
  184.         
  185.         Decimal.serialize(self, elt, sw, pyobj, name = name, orig = orig, **kw)
  186.  
  187.  
  188. if __name__ == '__main__':
  189.     print _copyright
  190.  
  191.